home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume10 / cbw / part07 < prev    next >
Encoding:
Internet Message Format  |  1987-06-17  |  37.7 KB

  1. Path: seismo!uunet!rs
  2. From: rs@uunet.UU.NET (Rich Salz)
  3. Newsgroups: comp.sources.unix
  4. Subject: v10i007:  Crypt Breaker's Workbench, Part07/11
  5. Message-ID: <389@uunet.UU.NET>
  6. Date: 19 Jun 87 03:16:12 GMT
  7. Organization: UUNET Communications Services, Arlington, VA
  8. Lines: 1381
  9. Approved: rs@uunet.uu.net
  10.  
  11. Submitted by: Robert W. Baldwin <BALDWIN@XX.LCS.MIT.EDU>
  12. Mod.sources: Volume 10, Issue 7
  13. Archive-name: cbw/Part07
  14.  
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then unpack
  18. # it by saving it into a file and typing "sh file".  To overwrite existing
  19. # files, type "sh file -c".  You can also feed this as standard input via
  20. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  21. # will see the following message at the end:
  22. #        "End of archive 7 (of 11)."
  23. # Contents:  dblock.c test3.perm
  24. # Wrapped by rs@uunet on Wed Jun 17 18:17:24 1987
  25. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  26. if test -f dblock.c -a "${1}" != "-c" ; then 
  27.   echo shar: Will not over-write existing file \"dblock.c\"
  28. else
  29. echo shar: Extracting \"dblock.c\" \(18401 characters\)
  30. sed "s/^X//" >dblock.c <<'END_OF_dblock.c'
  31. X/*
  32. X * Decrytion block and its label.
  33. X *
  34. X * Robert W. Baldwin, December 1984.
  35. X */
  36. X
  37. X
  38. X#include    <stdio.h>
  39. X#include    "window.h"
  40. X#include    "terminal.h"
  41. X#include    "layout.h"
  42. X#include    "specs.h"
  43. X
  44. X
  45. X/* Relative layout constants. */
  46. X
  47. X#define    TOPROW        2        /* First non-blank row. */
  48. X#define    BOTROW        (TOPROW+2*(NLINES-1))    /* First non-blank row. */
  49. X#define DBSHELP    \
  50. X    "^G: undo, ^T: tryall, ^W: wrdsrch, F2 F1: next prev block"
  51. X#define WIREWIDTH    23    /* Number of chars from WIREFORMAT */
  52. X#define WIREFORMAT    "Know %3d of 128 wires  "
  53. X#define    WIRECOL        (LINELEN - WIREWIDTH + 1)  /* Starting column. */
  54. X#define    BLOCKFORMAT    "Block - %d"
  55. X
  56. X/* Keystroke handler for decryption block storage. */
  57. X
  58. Xextern    dbsup(), dbsdown(), dbsleft(), dbsright();
  59. Xextern    dbskey();
  60. Xextern    dbsundo();
  61. Xextern    dbsdelf();
  62. Xextern    dbsdelb();
  63. Xextern    dbsnxtblk();
  64. Xextern    dbsprvblk();
  65. Xextern    dbstryall();
  66. Xextern    dbswrdsrch();
  67. X
  68. Xkeyer    dbsktab[] = {
  69. X        {CTRYALL, dbstryall},
  70. X        {CWRDSRCH, dbswrdsrch},
  71. X        {CNEXTBLOCK, dbsnxtblk},
  72. X        {CPREVBLOCK, dbsprvblk},
  73. X        {CGO_UP, dbsup},
  74. X        {CGO_DOWN, dbsdown},
  75. X        {CGO_LEFT, dbsleft},
  76. X        {CGO_RIGHT, dbsright},
  77. X        {CUNDO, dbsundo},
  78. X        {CDELF, dbsdelf},
  79. X        {CDELB, dbsdelb},
  80. X        {CINSERT, dbskey},
  81. X        {CRETURN, dbskey},    /* Special case return key. */
  82. X        {0, NULL},
  83. X        };
  84. X
  85. X
  86. X
  87. X/* Private data for the decryption block storage. */
  88. X
  89. X#include     "dblock.h"
  90. X
  91. Xchar    mcbuf[BLOCKSIZE+1];        /* Static buffer for now. */
  92. Xint    mpbuf[BLOCKSIZE+1];        /* Static buffer for now. */
  93. Xint    moperm[BLOCKSIZE+1];        /* Static buffer for now. */
  94. Xchar    mmbuf[BLOCKSIZE+1];        /* Static buffer for now. */
  95. Xint    mcmdbuf[BLOCKSIZE+1];        /* Static buffer for now. */
  96. X
  97. Xdbsinfo dbsprivate;
  98. X
  99. X
  100. X
  101. X/* Window for the decryption block label. */
  102. X
  103. Xdispline    dblline1 = {
  104. X        DBLROW,1,        /* Origin. */
  105. X        1,DBWIDTH,        /* Height and width. */
  106. X        1,1,            /* Init (relative) cursor position */
  107. X        NULL,            /* No private data. */
  108. X        wl_setcur,        /* Firstime = restore cursor pos. */
  109. X        wl_noop,        /* Lasttime = do nothing. */
  110. X        wl_dldraw,        /* Default dispaly line draw routine */
  111. X        dokey,            /* Default keystroke handler. */
  112. X        arwktab,        /* Basic arrow keystroke handler. */
  113. X        1,DBWIDTH,        /* Min and Max col for cursor. */
  114. X};
  115. X
  116. Xdispline    *dbllines[] = {
  117. X        &dblline1,        /* List of lines for the label. */
  118. X        NULL,
  119. X};
  120. X
  121. Xtwindow        dblabel = {
  122. X        DBLROW,1,        /* Origin. */
  123. X        1,DBWIDTH,        /* Height and width. */
  124. X        1,1,            /* Init (relative) cursor position */
  125. X        NULL,            /* No private info. */
  126. X        wl_setcur,        /* Firstime = restore cursor pos. */
  127. X        wl_noop,        /* Lasttime = do nothing. */
  128. X        wl_twdraw,        /* Simple draw routine. */
  129. X        dokey,            /* Default keystroke handler. */
  130. X        arwktab,        /* Basic arrow keystroke handler. */
  131. X        dbllines,
  132. X};
  133. X
  134. X
  135. X/* Window for the decrytion block. */
  136. X
  137. Xextern    int    dbsdraw();
  138. Xextern    int    dbsfirst();
  139. Xextern    int    dbslast();
  140. X
  141. Xgwindow        dbstore = {
  142. X        DBSROW,1,        /* Origin. */
  143. X        DBHEIGHT,DBWIDTH,    /* Height and width. */
  144. X        TOPROW,1,        /* Initial cursor position */
  145. X        ((char *)&dbsprivate),    /* Info about current block. */
  146. X        dbsfirst,        /* Firstime */
  147. X        dbslast,        /* Lasttime */
  148. X        dbsdraw,        /* Draw routine. */
  149. X        dokey,            /* Default keystroke handler. */
  150. X        dbsktab,        /* Arrow keystroke handler. */
  151. X};
  152. X
  153. X
  154. X
  155. X/* Initialize the decrypted block label, and return a ptr to it.
  156. X */
  157. Xgwindow    *(idblabel())
  158. X{
  159. X    displine    *line;
  160. X
  161. X    line = dblabel.dlines[0];
  162. X    clrdline(line);
  163. X    return ((gwindow *) &dblabel);
  164. X}
  165. X
  166. X
  167. X/* Set the block number in the label.
  168. X * The argument, num, is displayed as it, it is not zero adjusted.
  169. X * The cursor is not moved, and the window is redisplayed.
  170. X */
  171. Xdblbnum(label, num)
  172. Xtwindow    *label;
  173. Xint    num;
  174. X{
  175. X    int    row,col;
  176. X
  177. X    row = rowcursor();
  178. X    col = colcursor();
  179. X
  180. X    sprintf(statmsg, BLOCKFORMAT, num);
  181. X    setrange(label->dlines[0], statmsg, 1, WIRECOL-1);
  182. X    wl_dldraw(label->dlines[0]);
  183. X    setcursor(row, col);
  184. X}
  185. X
  186. X
  187. X/* Set the known wire number in the label.
  188. X * The argument, num, is displayed as it, it is not zero adjusted.
  189. X * The cursor is not moved, and the window is redisplayed.
  190. X */
  191. Xdblpcount(label, num)
  192. Xtwindow    *label;
  193. Xint    num;
  194. X{
  195. X    int    row,col;
  196. X
  197. X    row = rowcursor();
  198. X    col = colcursor();
  199. X
  200. X    sprintf(statmsg, WIREFORMAT, num);
  201. X    setnadline(label->dlines[0], statmsg, WIRECOL);
  202. X    wl_dldraw(label->dlines[0]);
  203. X    setcursor(row, col);
  204. X}
  205. X
  206. X
  207. X
  208. X/* Initialize the decryption block storage, and return a ptr to it.
  209. X * Reads in cipher block from the file named by cipherfile.
  210. X * If errors occur, a message is put in the status area.
  211. X */
  212. Xgwindow    *(idbstore())
  213. X{
  214. X    gwindow        *dbs;
  215. X    dbsinfo        *dbsi;
  216. X    FILE        *fd;
  217. X
  218. X    dbs = &dbstore;
  219. X    dbsi = ((dbsinfo *) dbs->wprivate);
  220. X
  221. X    dbsi->cbuf = mcbuf;
  222. X    dbsi->blknum = 0;
  223. X    fillcbuf(dbsi->blknum, dbsi->cbuf);
  224. X    dbsi->perm = refperm(dbsi->blknum);
  225. X    dbsi->pbuf = mpbuf;
  226. X    dbsi->mbuf = mmbuf;
  227. X    dbsi->cmdbuf = mcmdbuf;
  228. X    dbsi->operm = moperm;
  229. X
  230. X    dbsinit(dbsi);
  231. X
  232. X    return (dbs);
  233. X}
  234. X
  235. X
  236. X/* Initialize the private data.
  237. X * Requires that the cipherblock and permutation have already been loaded.
  238. X * The plaintext is decoded from the ciphertext and permutation.
  239. X * Updates the label display.
  240. X */
  241. Xdbsinit(dbsi)
  242. Xdbsinfo    *dbsi;
  243. X{
  244. X    int        i;
  245. X
  246. X    dbsi->wirecnt = permwcount(dbsi->perm);
  247. X    dbsi->cmdloc = 0;
  248. X    dbsi->cmdnext = 0;
  249. X    dbsi->cmdbuf[0] = 0;
  250. X    dblbnum(&dblabel, dbsi->blknum);
  251. X    dblpcount(&dblabel, dbsi->wirecnt);
  252. X
  253. X    for (i = 0 ; i < BLOCKSIZE ; i++)  {
  254. X        dbsi->operm[i] = dbsi->perm[i];
  255. X        dbsi->mbuf[i] = FALSE;
  256. X        }
  257. X
  258. X    decode(dbsi->cbuf, dbsi->pbuf, dbsi->perm);
  259. X}
  260. X
  261. X
  262. X
  263. X/* Atomically merge the given permutation into the current one.
  264. X * The current one is not changed if any conflicts are detected.
  265. X * Updates the display and plaintext buffer.
  266. X * Does setup to allow an undo.
  267. X * Return TRUE if suceesful.
  268. X */
  269. Xint    dbsmerge(dbs, perm)
  270. Xgwindow    *dbs;        /* Ptr to dbstore */
  271. Xint    perm[];        /* Permutation */
  272. X{
  273. X    int    i;
  274. X    dbsinfo    *dbsi;
  275. X    dbsi = ((dbsinfo *) dbs->wprivate);
  276. X
  277. X    /* Check for conflicts, display msg if so. */
  278. X    for (i = 0 ; i < BLOCKSIZE ; i++)  {
  279. X        if (perm[i] != NONE  &&  dbsi->perm[i] != NONE
  280. X         && perm[i] != dbsi->perm[i]) {
  281. X            sprintf(statmsg, "Guess conflicts with current plaintext!");
  282. X            usrstatus(&user, statmsg);
  283. X            return(FALSE);
  284. X            }
  285. X        }
  286. X
  287. X    /* Use dbssperm to set the guess.  Save old perm for undo. */
  288. X    dbsi->cmdnext = 0;
  289. X    dbsi->cmdloc = dbsrc2pos(dbs->wcur_row, dbs->wcur_col);
  290. X    for (i = 0 ; i < BLOCKSIZE ; i++)  {
  291. X        dbsi->operm[i] = dbsi->perm[i];
  292. X        }
  293. X
  294. X    dbsrmarks(dbs);
  295. X    for (i = 0 ; i < BLOCKSIZE ; i++)  {
  296. X        if (perm[i] != NONE  &&  perm[i] > i  &&  dbsi->perm[i] == NONE) {
  297. X            dbsswire(dbs, i, perm[i]);
  298. X            }
  299. X        }
  300. X
  301. X    sprintf(statmsg, "Sucessful merge.");
  302. X    usrstatus(&user, statmsg);
  303. X    dbsi->wirecnt = permwcount(dbsi->perm);
  304. X    dblpcount(&dblabel, dbsi->wirecnt);
  305. X    return(TRUE);
  306. X}
  307. X
  308. X
  309. X/* Undo the last command.
  310. X * Copy the old permutation into the current one,
  311. X * recompute the plaintext, and update the display.
  312. X * Move the cursor back to where it was.
  313. X */
  314. Xdbsundo(dbs)
  315. Xgwindow    *dbs;
  316. X{
  317. X    int    i;
  318. X    dbsinfo    *dbsi;
  319. X    dbsi = ((dbsinfo *) dbs->wprivate);
  320. X
  321. X    for (i = 0 ; i < BLOCKSIZE ; i++)  {
  322. X        dbsi->mbuf[i] = FALSE;
  323. X        dbsi->perm[i] = dbsi->operm[i];
  324. X        }
  325. X    decode(dbsi->cbuf, dbsi->pbuf, dbsi->perm);
  326. X    dbsdraw(dbs);
  327. X
  328. X    dbsi->wirecnt = permwcount(dbsi->perm);
  329. X    dblpcount(&dblabel, dbsi->wirecnt);
  330. X    usrstatus(&user, "Command undone.");
  331. X    wl_setcur(dbs, dbsp2row(dbsi->cmdloc), dbsp2col(dbsi->cmdloc));
  332. X}
  333. X
  334. X
  335. X
  336. X/* (re)Draw the window.
  337. X */
  338. Xdbsdraw(dbs)
  339. Xgwindow    *dbs;
  340. X{
  341. X    int    i;
  342. X    int    row, col;
  343. X    dbsinfo    *dbsi;
  344. X
  345. X    dbsi = ((dbsinfo *) dbs->wprivate);
  346. X    row = dbs->wcur_row;
  347. X    col = dbs->wcur_col;
  348. X
  349. X    for (i = 0 ; i < BLOCKSIZE ; i++)  {
  350. X        if (i%LINELEN == 0) {
  351. X            wl_setcur(dbs, dbsp2row(i), dbsp2col(i));
  352. X            }
  353. X        plnchars(1, char2sym(dbsi->pbuf[i]));
  354. X        }
  355. X
  356. X    for (i = 0 ; i < BLOCKSIZE ; i++)  {
  357. X        if (i%LINELEN == 0) {
  358. X            wl_setcur(dbs, dbsp2row(i)+1, dbsp2col(i));
  359. X            }
  360. X        if (dbsi->mbuf[i]) {
  361. X            plnchars(1, SUNDERLINE);
  362. X            }
  363. X        else  {
  364. X            plnchars(1, ' ');
  365. X            }
  366. X        }
  367. X
  368. X    for (i = dbsp2row(BLOCKSIZE) ; i <= DBHEIGHT ; i++) {
  369. X        wl_setcur(dbs, i, 1);
  370. X        plnchars(LINELEN, ' ');
  371. X        }
  372. X    for (i = 1 ; i < dbsp2row(0) ; i++) {
  373. X        wl_setcur(dbs, i, 1);
  374. X        plnchars(LINELEN, ' ');
  375. X        }
  376. X
  377. X    for (i = 1 ; i <= DBHEIGHT ; i++) {
  378. X        wl_setcur(dbs, i, LINELEN+1);
  379. X        plnchars(dbs->wwidth - LINELEN, ' ');
  380. X        }
  381. X
  382. X    wl_setcur(dbs, row, col);
  383. X
  384. X}
  385. X
  386. X
  387. X
  388. X/* Draw the plaintext characters on the screen.
  389. X * Does not change the cursor position.
  390. X */
  391. Xdbsdpbuf(dbs)
  392. Xgwindow    *dbs;
  393. X{
  394. X    int    i;
  395. X    dbsinfo    *dbsi;
  396. X
  397. X    dbsi = ((dbsinfo *) dbs->wprivate);
  398. X    for (i = 0 ; i < BLOCKSIZE ; i++)  {
  399. X        dbsdpchar(dbs, i, dbsi->pbuf[i]);
  400. X        }
  401. X}
  402. X
  403. X
  404. X/* Display the given plaintext character at the given cipher block position.
  405. X * Cipher block positions are zero-based.
  406. X * Handles mapping of block positions to window coordinates.
  407. X * It does not move the cursor.
  408. X * It does set pbuf.
  409. X */
  410. Xdbsdpchar(dbs, pos, pchar)
  411. Xgwindow    *dbs;
  412. Xint        pos;
  413. Xint        pchar;                /* -1 means no char. */
  414. X{
  415. X    int    row, col;            /* Original position. */
  416. X    dbsinfo    *dbsi;
  417. X
  418. X    dbsi = ((dbsinfo *) dbs->wprivate);
  419. X    row = dbs->wcur_row;
  420. X    col = dbs->wcur_col;
  421. X
  422. X    wl_setcur(dbs, dbsp2row(pos), dbsp2col(pos));
  423. X    plnchars(1, char2sym(pchar));
  424. X    dbsi->pbuf[pos] = pchar;
  425. X    wl_setcur(dbs, row, col);
  426. X}
  427. X
  428. X
  429. X
  430. X/* Convert cipher block position to window row coordinate.
  431. X */
  432. Xdbsp2row(pos)
  433. Xint        pos;
  434. X{
  435. X    return(TOPROW + 2*(pos/LINELEN));
  436. X}
  437. X
  438. X
  439. X/* Convert cipher block position to window column coordinate.
  440. X */
  441. Xdbsp2col(pos)
  442. Xint        pos;
  443. X{
  444. X    return(1 + (pos%LINELEN));
  445. X}
  446. X
  447. X
  448. X/* Convert window row and column positions into a  cipher block position.
  449. X */
  450. Xint    dbsrc2pos(row, col)
  451. Xint        row, col;
  452. X{
  453. X    return( ((row-TOPROW)/2)*LINELEN  +  (col-1) );
  454. X}
  455. X
  456. X
  457. X
  458. X/* Reset all the character marks that are set and update the display.
  459. X */
  460. Xdbsrmarks(dbs)
  461. Xgwindow    *dbs;
  462. X{
  463. X    int    i;
  464. X    dbsinfo    *dbsi;
  465. X
  466. X    dbsi = ((dbsinfo *) dbs->wprivate);
  467. X    for (i = 0 ; i < BLOCKSIZE ; i++)  {
  468. X        if (dbsi->mbuf[i])  dbscmark(dbs, i);
  469. X        }
  470. X}
  471. X
  472. X
  473. X/* (re)Draw all the set character marks.
  474. X * Assumes that the window has been erased.
  475. X * Cursor restored to its original place.
  476. X */
  477. Xdbsdmarks(dbs)
  478. Xgwindow    *dbs;
  479. X{
  480. X    int    i;
  481. X    dbsinfo    *dbsi;
  482. X
  483. X    dbsi = ((dbsinfo *) dbs->wprivate);
  484. X    for (i = 0 ; i < BLOCKSIZE ; i++)  {
  485. X        if (dbsi->mbuf[i])  {
  486. X            dbssmark(dbs, i);
  487. X            }
  488. X        }
  489. X}
  490. X
  491. X
  492. X/* Set a mark under the given cipher block position and
  493. X * update the mark flags.
  494. X * Doesn't change the cursor position.
  495. X */
  496. Xdbssmark(dbs, pos)
  497. Xgwindow    *dbs;
  498. X{
  499. X    int    row, col;            /* Original position. */
  500. X    dbsinfo    *dbsi;
  501. X
  502. X    dbsi = ((dbsinfo *) dbs->wprivate);
  503. X    row = dbs->wcur_row;
  504. X    col = dbs->wcur_col;
  505. X
  506. X    wl_setcur(dbs, 1+dbsp2row(pos), dbsp2col(pos));
  507. X    plnchars(1, SUNDERLINE);
  508. X    dbsi->mbuf[pos] = TRUE;
  509. X
  510. X    wl_setcur(dbs, row, col);
  511. X}
  512. X
  513. X
  514. X/* Clear the mark under the given cipher block position and
  515. X * update the mark flags.
  516. X * Doesn't change the cursor position.
  517. X */
  518. Xdbscmark(dbs, pos)
  519. Xgwindow    *dbs;
  520. X{
  521. X    int    row, col;            /* Original position. */
  522. X    dbsinfo    *dbsi;
  523. X
  524. X    dbsi = ((dbsinfo *) dbs->wprivate);
  525. X    row = dbs->wcur_row;
  526. X    col = dbs->wcur_col;
  527. X
  528. X    wl_setcur(dbs, 1+dbsp2row(pos), dbsp2col(pos));
  529. X    plnchars(1,' ');
  530. X    dbsi->mbuf[pos] = FALSE;
  531. X
  532. X    wl_setcur(dbs, row, col);
  533. X}
  534. X
  535. X
  536. X
  537. X/* Set the permutation to reflect the fact that the
  538. X * character at pos is pchar.
  539. X * Update the display to reflect the changes.
  540. X * Highlight all changes.
  541. X * Add the character to the command string, clearing the old
  542. X * marks if this is the first command character.
  543. X * By setting pchar to NONE, this can be used to clear the permutation.
  544. X * The cursor position is not changed.
  545. X */
  546. Xdbssperm(dbs, pos, pchar)
  547. Xgwindow    *dbs;
  548. Xint    pos;
  549. Xint    pchar;
  550. X{
  551. X    int    i;
  552. Xreg    dbsinfo    *dbsi;
  553. X    char    *p;
  554. X    int    x;        /* Shifted up cipher text character. */
  555. X    int    y;        /* Shifted up plain text character. */
  556. X
  557. X    dbsi = ((dbsinfo *) dbs->wprivate);
  558. X
  559. X    if (dbsi->cmdnext == 0)  {        /* Starting new command. */
  560. X        dbsrmarks(dbs);
  561. X        for (i = 0 ; i < BLOCKSIZE ; i++)  {
  562. X            dbsi->operm[i] = dbsi->perm[i];
  563. X            }
  564. X        dbsi->cmdloc = pos;
  565. X        }
  566. X    dbsi->cmdbuf[dbsi->cmdnext++] = pchar;
  567. X
  568. X    if (pchar == NONE) {        /* Just clear the permutation. */
  569. X        x = (dbsi->cbuf[pos] + pos) & MODMASK;
  570. X        y = dbsi->perm[x];
  571. X        if (y != NONE)  dbscwire(dbs, x, y&MODMASK);
  572. X        return;
  573. X        }
  574. X
  575. X    x = (dbsi->cbuf[pos] + pos) & MODMASK;
  576. X    y = (pchar + pos) & MODMASK;
  577. X    dbsswire(dbs, x, y);
  578. X}
  579. X
  580. X
  581. X/* Clear the wiring for perm[x] equals y and update the display.
  582. X * Requires that x be in fact wired to y.
  583. X */
  584. Xdbscwire(dbs, x, y)
  585. Xgwindow    *dbs;
  586. Xint    x, y;
  587. X{
  588. X    int    i;
  589. X    dbsinfo    *dbsi;
  590. X    char    *p;
  591. X
  592. X    dbsi = ((dbsinfo *) dbs->wprivate);
  593. X    if (dbsi->perm[x] != y  ||  x == NONE)  return;
  594. X    if (y != NONE)  dbsi->wirecnt--;
  595. X
  596. X    permchgflg = TRUE;
  597. X    x = x&MODMASK;
  598. X    y = y&MODMASK;
  599. X    dbsi->perm[x] = NONE;
  600. X    dbsi->perm[y] = NONE;
  601. X
  602. X    for (i = 0 ; i < BLOCKSIZE ; i++)  {
  603. X        if ( ((((dbsi->cbuf[i])+i)&MODMASK) == x)
  604. X          || ((((dbsi->cbuf[i])+i)&MODMASK) == y) ) {
  605. X            dbsdpchar(dbs, i, NONE);
  606. X            dbscmark(dbs, i);
  607. X            }
  608. X        }
  609. X
  610. X}
  611. X
  612. X
  613. X/* Set the wiring for perm[x] equals y and update the display.
  614. X * Clear any wiring that was set.
  615. X * Requires x and y not be NONE.
  616. X */
  617. Xdbsswire(dbs, x, y)
  618. Xgwindow    *dbs;
  619. Xint    x, y;
  620. X{
  621. X    int    i;
  622. X    char    *p;
  623. X    dbsinfo    *dbsi;
  624. X    dbsi = ((dbsinfo *) dbs->wprivate);
  625. X
  626. X    if (x == NONE  ||  y == NONE)  return;
  627. X    x = x&MODMASK;
  628. X    y = y&MODMASK;
  629. X    permchgflg = TRUE;
  630. X
  631. X    if (dbsi->perm[x] != y)  {
  632. X        if (dbsi->perm[x] != NONE)  dbscwire(dbs, x, dbsi->perm[x]);
  633. X        if (dbsi->perm[y] != NONE)  dbscwire(dbs, y, dbsi->perm[y]);
  634. X        }
  635. X    if (dbsi->perm[x] == NONE)  dbsi->wirecnt++;
  636. X    dbsi->perm[x] = y;
  637. X    dbsi->perm[y] = x;
  638. X
  639. X    for (i = 0 ; i < BLOCKSIZE ; i++)  {
  640. X        if ((((dbsi->cbuf[i])+i)&MODMASK) == x)  {
  641. X            dbsi->pbuf[i] = (y - i) & MODMASK;
  642. X            }
  643. X        else if ((((dbsi->cbuf[i])+i)&MODMASK) == y)  {
  644. X            dbsi->pbuf[i] = (x - i) & MODMASK;
  645. X            }
  646. X        else  {continue;}
  647. X        dbsdpchar(dbs, i, dbsi->pbuf[i]);    /* Found one. */
  648. X        dbssmark(dbs, i);
  649. X        }
  650. X}
  651. X
  652. X
  653. X
  654. X/* Behavior when cursor enters the window.
  655. X * Indicate that we are at the beginning of a command.
  656. X * Put up help message.
  657. X */
  658. Xdbsfirst(dbs, row, col)
  659. Xgwindow    *dbs;
  660. Xint    row, col;        /* Relative to window's origin. */
  661. X{
  662. X    dbsinfo    *dbsi;
  663. X
  664. X    dbsi = ((dbsinfo *) dbs->wprivate);
  665. X    dbsi->cmdnext = 0;
  666. X    usrhelp(&user, DBSHELP);
  667. X    wl_setcur(dbs, dbs->wcur_row, col);
  668. X}
  669. X
  670. X
  671. X/* Behavior when cursor leaves the window.
  672. X * Complete the command and give it to the history window.
  673. X */
  674. Xdbslast(dbs)
  675. Xgwindow    *dbs;
  676. X{
  677. X    dbscmddone(dbs);
  678. X}
  679. X
  680. X
  681. X/* A command may be done, if so, send it to the history window.
  682. X * Setup for undo.
  683. X */
  684. Xdbscmddone(dbs)
  685. Xgwindow    *dbs;
  686. X{
  687. X    int        i;
  688. X    dbsinfo    *dbsi;
  689. X
  690. X    dbsi = ((dbsinfo *) dbs->wprivate);
  691. X    if (dbsi->cmdnext != 0)  {
  692. X        dbsi->cmdbuf[dbsi->cmdnext++] = 0;
  693. X/*        hstadd(&history, dbsi->cmdbuf);
  694. X*/
  695. X        dbsi->cmdnext = 0;
  696. X        }
  697. X}
  698. X
  699. X
  700. X
  701. X/* Cursor movement commands.
  702. X * Keep the cursor on the pchar lines.
  703. X * Moving off the end of a line advances to the next or previous line.
  704. X * Moving the cursor also terminates any command that might
  705. X * have been entered.
  706. X */
  707. Xdbsup(dbs, k)
  708. Xgwindow    *dbs;
  709. X{
  710. X    int    row, col;        /* Current relative cursor position. */
  711. X    
  712. X    row = dbs->wcur_row;
  713. X    col = dbs->wcur_col;
  714. X    
  715. X    if (row <= TOPROW)  {
  716. X        wl_setcur(dbs, 1, col);
  717. X        dbs->wcur_row = TOPROW;
  718. X        jogcursor(1);
  719. X        if (wl_hascur(dbs))
  720. X              wl_rcursor(dbs);
  721. X    }
  722. X    else {
  723. X        jogup(dbs, k);
  724. X        jogup(dbs, k);
  725. X    }
  726. X    dbscmddone(dbs);
  727. X}
  728. X
  729. Xdbsdown(dbs, k)
  730. Xgwindow    *dbs;
  731. X{
  732. X    int    row, col;        /* Current relative cursor position. */
  733. X    
  734. X    row = dbs->wcur_row;
  735. X    col = dbs->wcur_col;
  736. X    
  737. X    if (row >= BOTROW)  {
  738. X        wl_setcur(dbs, DBHEIGHT, col);
  739. X        dbs->wcur_row = BOTROW;
  740. X        jogcursor(2);
  741. X        if (wl_hascur(dbs))
  742. X              wl_rcursor(dbs);
  743. X        }
  744. X    else {
  745. X        jogdown(dbs, k);
  746. X        jogdown(dbs, k);
  747. X        }
  748. X    dbscmddone(dbs);
  749. X}
  750. X
  751. Xdbsleft(dbs, k)
  752. Xgwindow    *dbs;
  753. X{
  754. X    int    row, col;        /* Current relative cursor position. */
  755. X    
  756. X    row = dbs->wcur_row;
  757. X    col = dbs->wcur_col;
  758. X    
  759. X    dbsprev(dbs);
  760. X    dbscmddone(dbs);
  761. X}
  762. X
  763. Xdbsright(dbs, k)
  764. Xgwindow    *dbs;
  765. X{
  766. X    int    row, col;        /* Current relative cursor position. */
  767. X    
  768. X    row = dbs->wcur_row;
  769. X    col = dbs->wcur_col;
  770. X    
  771. X    dbsnext(dbs);
  772. X    dbscmddone(dbs);
  773. X}
  774. X
  775. X
  776. X/* Backup the cursor to the previous position without terminating
  777. X * a command.
  778. X */
  779. Xdbsprev(dbs)
  780. Xgwindow    *dbs;
  781. X{
  782. X    int    row, col;        /* Current relative cursor position. */
  783. X
  784. X    row = dbs->wcur_row;
  785. X    col = dbs->wcur_col;
  786. X
  787. X    if (col <= 1  &&  row <= TOPROW)  {
  788. X        }
  789. X    else if (col <= 1)  {
  790. X        wl_setcur(dbs, row-2, LINELEN);
  791. X        }
  792. X    else {
  793. X        jogleft(dbs);
  794. X        }
  795. X}
  796. X
  797. X
  798. X/* Advance the cursor to the next position without terminating
  799. X * a command.
  800. X */
  801. Xdbsnext(dbs)
  802. Xgwindow    *dbs;
  803. X{
  804. X    int    row, col;        /* Current relative cursor position. */
  805. X
  806. X    row = dbs->wcur_row;
  807. X    col = dbs->wcur_col;
  808. X
  809. X    if (col >= LINELEN  &&  row >= BOTROW)  {
  810. X        }
  811. X    else if (col >= LINELEN)  {
  812. X        wl_setcur(dbs, row+2, 1);
  813. X        }
  814. X    else {
  815. X        jogright(dbs);
  816. X        }
  817. X}
  818. X
  819. X
  820. X
  821. X/* Add the character to the permutation.
  822. X */
  823. Xdbskey(dbs, k)
  824. Xgwindow    *dbs;
  825. Xint    k;
  826. X{
  827. X    int    pos;        /* plaintext block position. */
  828. X    dbsinfo    *dbsi;
  829. X
  830. X    dbsi = ((dbsinfo *) dbs->wprivate);
  831. X    pos = dbsrc2pos(dbs->wcur_row, dbs->wcur_col);
  832. X    dbssperm(dbs, pos, k & CHARM);
  833. X    dbsnext(dbs);
  834. X    dblpcount(&dblabel, dbsi->wirecnt);
  835. X}
  836. X
  837. X
  838. X
  839. X/* Delete forward.
  840. X * Clear the wiring due to the character at the current position,
  841. X * and update the display.
  842. X * The cursor moves forward one position.
  843. X */
  844. Xdbsdelf(dbs)
  845. Xgwindow    *dbs;
  846. X{
  847. X    int    pos;        /* plaintext block position. */
  848. X    dbsinfo    *dbsi;
  849. X
  850. X    dbsi = ((dbsinfo *) dbs->wprivate);
  851. X    pos = dbsrc2pos(dbs->wcur_row, dbs->wcur_col);
  852. X
  853. X    dbssperm(dbs, pos, NONE);
  854. X    dbsnext(dbs);
  855. X    dblpcount(&dblabel, dbsi->wirecnt);
  856. X}
  857. X
  858. X
  859. X
  860. X/* Delete backwards.
  861. X * Clear the wiring due to the character at the previous position,
  862. X * and update the display.
  863. X * The cursor moves backwards one position.
  864. X */
  865. Xdbsdelb(dbs)
  866. Xgwindow    *dbs;
  867. X{
  868. X    int    pos;        /* plaintext block position. */
  869. X    dbsinfo    *dbsi;
  870. X
  871. X    dbsi = ((dbsinfo *) dbs->wprivate);
  872. X    pos = dbsrc2pos(dbs->wcur_row, dbs->wcur_col);
  873. X    if (pos == 0)  return;
  874. X    pos = pos - 1;
  875. X
  876. X    dbssperm(dbs, pos, NONE);
  877. X    dbsprev(dbs);
  878. X    dblpcount(&dblabel, dbsi->wirecnt);
  879. X}
  880. X
  881. X
  882. X
  883. X/* Advance to the next cipher text block (if any).
  884. X */
  885. Xdbsnxtblk(dbs)
  886. Xgwindow    *dbs;
  887. X{
  888. X    dbsinfo    *dbsi;
  889. X    dbsi = ((dbsinfo *) dbs->wprivate);
  890. X
  891. X    dbssetblk(dbs, dbsi->blknum + 1);
  892. X}
  893. X
  894. X
  895. X/* Backup to the previous cipher text block (if any).
  896. X */
  897. Xdbsprvblk(dbs)
  898. Xgwindow    *dbs;
  899. X{
  900. X    dbsinfo    *dbsi;
  901. X    dbsi = ((dbsinfo *) dbs->wprivate);
  902. X
  903. X    dbssetblk(dbs, dbsi->blknum - 1);
  904. X}
  905. X
  906. X
  907. X/* Jump to a particular block number.
  908. X * Get a new permutation and update the display.
  909. X * Even if the block number hasn't change, the permutation may have,
  910. X * so we must re-decode the block.
  911. X */
  912. Xdbssetblk(dbs, blocknum)
  913. Xgwindow    *dbs;
  914. Xint    blocknum;
  915. X{
  916. X    dbsinfo    *dbsi;
  917. X    dbsi = ((dbsinfo *) dbs->wprivate);
  918. X
  919. X    if (fillcbuf(blocknum, dbsi->cbuf)
  920. X     && (dbsi->perm = refperm(blocknum))) {
  921. X        dbsi->blknum = blocknum;
  922. X        dbsinit(dbsi);
  923. X        dbsdraw(dbs);
  924. X        usrstatus(&user, "Ready.");
  925. X        }
  926. X    else {
  927. X        usrstatus(&user, "Block number is out of range.");
  928. X        }
  929. X}
  930. X
  931. X
  932. X/* Return the number of the current block.
  933. X */
  934. Xdbsgetblk(dbs)
  935. Xgwindow    *dbs;
  936. X{
  937. X    dbsinfo    *dbsi;
  938. X    dbsi = ((dbsinfo *) dbs->wprivate);
  939. X
  940. X    return(dbsi->blknum);
  941. X}
  942. END_OF_dblock.c
  943. if test 18401 -ne `wc -c <dblock.c`; then
  944.     echo shar: \"dblock.c\" unpacked with wrong size!
  945. fi
  946. # end of overwriting check
  947. fi
  948. if test -f test3.perm -a "${1}" != "-c" ; then 
  949.   echo shar: Will not over-write existing file \"test3.perm\"
  950. else
  951. echo shar: Extracting \"test3.perm\" \(16800 characters\)
  952. sed "s/^X//" >test3.perm <<'END_OF_test3.perm'
  953. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  954. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  955. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  956. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  957. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  958. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  959. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  960. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  961. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  962. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  963. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  964. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  965. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  966. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  967. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  968. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  969. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  970. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  971. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  972. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  973. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  974. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  975. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  976. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  977. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  978. X -1  -1  -1  -1  -1  -1 
  979. X 96 114 124 223  97  19  -1  13  43  44 
  980. X -1  38 231   7  -1 207 179 134 133   5 
  981. X -1  -1  48 160 152  93 162  -1 191 127 
  982. X 65 103 183  -1  -1 193 243 242  11 180 
  983. X 87 173 154   8   9  99 112  58  22 108 
  984. X199  95  77  66  -1  62 128 190  47  79 
  985. X215 109  55 245  73  30  53 178 214  82 
  986. X201 138 206  64 240  -1 228  52 140  59 
  987. X197  -1  69 203  -1 111 137  40  -1 139 
  988. X -1 195 212  25  -1  51   0   4 251  45 
  989. X -1 122 148  31 227 234 167 202  49  61 
  990. X219  85  46 246   1  -1  -1 254 211 249 
  991. X144 255 101 218   2 150 186  29  56  -1 
  992. X -1 247 164  18  17  -1  -1  86  71  89 
  993. X 78 205  -1 222 120 216 226 158 102 189 
  994. X125 225  24  -1  42 159 221 188 147 155 
  995. X 23 210  26  -1 132 232 184 106  -1  -1 
  996. X -1 196 253  41 204  -1  -1 235  67  16 
  997. X 39 192  -1  32 166  -1 126 224 157 149 
  998. X 57  28 181  35 241  91 171  80  -1  50 
  999. X -1  70 107  83 174 141  72  15  -1 233 
  1000. X161 118  92 244  68  60 145  -1 123 110 
  1001. X237 156 143   3 187 151 146 104  76 239 
  1002. X -1  12 165 209 105 177  -1 220  -1 229 
  1003. X 74 194  37  36 213  63 113 131  -1 119 
  1004. X -1  98  -1 172 117 121 
  1005. X 20 122 118 119  -1 229 158  -1 223  -1 
  1006. X215  -1 197 249  82 126 237  23  87  93 
  1007. X  0  -1 252  17  -1  -1  -1 225  -1 163 
  1008. X 52 171  -1 155 214  -1  84  -1 216  85 
  1009. X 45 152  -1 181  -1  40 241 235 142 210 
  1010. X -1  69  30  83  99 134 212 253  70 144 
  1011. X -1  -1 234  -1 132 250 173 114  95  51 
  1012. X 58  -1  73  72 175 168 211  -1  92 169 
  1013. X176 166  14  53  36  39  -1  18 148 117 
  1014. X129 255  78  19 110  68 151 154 101  54 
  1015. X244  98 242 147 227 204 128 203 188 254 
  1016. X 94 217 170 251  67 231  -1  89   2   3 
  1017. X206 146   1 183  -1 209  15 150 106  90 
  1018. X184 159  64 141  55 238 195  -1 162 205 
  1019. X245 133  48  -1  59 165 121 103  88  -1 
  1020. X127  96  41  -1  97  33  -1  -1   6 131 
  1021. X187 194 138  29 167 145  81 164  75  79 
  1022. X112  31 178  66  -1  74  80  -1 172  -1 
  1023. X -1  43 224 123 130 236  -1 160 108 246 
  1024. X192 230 190 222 161 136  -1  12 200 213 
  1025. X198 239 248 107 105 139 120  -1 247 125 
  1026. X 49  76  56 199  34  10  38 111 233  -1 
  1027. X -1  -1 193   8 182  27  -1 104 240   5 
  1028. X191 115  -1 218  62  47 185  16 135 201 
  1029. X228  46 102  -1 100 140 189 208 202  13 
  1030. X 65 113  22  57 109  91 
  1031. X 90  49  26 132 156 140 212 129  -1 122 
  1032. X198  -1  97 148  38  79  25 154  80  -1 
  1033. X214 216 248 184 161  16   2 107  66 168 
  1034. X 33  -1 195  30  -1  -1  65  -1  14  84 
  1035. X222  -1 123  53 136  47  69  45  -1   1 
  1036. X125  -1 134  43  -1 102 145 126 238 194 
  1037. X 78 232 138 246 224  36  28 225  -1  46 
  1038. X130 215 120 188 119 105 231 209  60  15 
  1039. X 18  87 185 176  39 160 182  81  -1 158 
  1040. X  0 151 235 192 183 200 118  12 174  -1 
  1041. X106  -1  55  -1  -1  75 100  27 249 187 
  1042. X163 242  -1 230 254 205 179 190  96  74 
  1043. X 72  -1   9  42 241  50  57 228 142   7 
  1044. X 70 206   3 149  52 227  44 220  62 245 
  1045. X  5 221 128 186 244  56 204  -1  13 133 
  1046. X -1  91 197 165  17  -1   4 180  89  -1 
  1047. X 85  24 193 110 199 153  -1  -1  29 255 
  1048. X177 247 226  -1  98 252  83 170 237 116 
  1049. X157 191  86  94  23  82 143 109  73 219 
  1050. X117 181  93 162  59  32  -1 152  10 164 
  1051. X 95  -1 250 239 146 115 131  -1 217  77 
  1052. X234  -1   6 251  20  71  21 208  -1 189 
  1053. X137 141  40 253  64  67 172 135 127 240 
  1054. X113  76  61  -1 210  92  -1 178  58 203 
  1055. X229 124 111  -1 144 139  63 171  22 108 
  1056. X202 213 175 223 114 169 
  1057. X 60  -1  26  79 203 204 122  -1  15  97 
  1058. X -1 238 133  33 159   8 165 145  27 191 
  1059. X192  69 250  -1  -1 183   2  18  50  65 
  1060. X218  57 143  13  -1  -1  -1  93 116 213 
  1061. X -1 199  -1 171 109  74  -1 177  56  -1 
  1062. X 28  -1  -1 196  -1 227  48  31  80 221 
  1063. X  0 248 202 103 233  29 140  -1 170  21 
  1064. X216 164 137 190  45 189  -1 193 188   3 
  1065. X 58 160 155 181 176  -1 186 104 111 225 
  1066. X198 125  -1  37  -1  -1 252   9 231 223 
  1067. X169  -1 255  63  87 154  -1  -1 152  44 
  1068. X201  88  -1  -1 179 118  38  -1 115 161 
  1069. X247 123   6 121 187  91  -1 240 241 239 
  1070. X197 207  -1  12  -1 185 138  72 136  -1 
  1071. X 66  -1 234  32 150  17 254  -1  -1 226 
  1072. X144  -1 108  -1 105  82 228 172 173  14 
  1073. X 81 119  -1  -1  71  16 208 246 242 100 
  1074. X 68  43 157 158  -1  -1  84  47 229 114 
  1075. X -1  83  -1  25 230 135  86 124  78  75 
  1076. X 73  19  20  77 245  -1  53 130  90  41 
  1077. X210 110  62   4   5 244 211 131 166 219 
  1078. X200 206 220  39  -1  -1  70  -1  30 209 
  1079. X212  59  -1  99 232  89 149  55 156 178 
  1080. X184  98 224  64 142 236 235  -1  11 129 
  1081. X127 128 168 249 205 194 167 120  61 243 
  1082. X 22  -1  96  -1 146 102 
  1083. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1084. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1085. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1086. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1087. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1088. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1089. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1090. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1091. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1092. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1093. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1094. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1095. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1096. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1097. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1098. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1099. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1100. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1101. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1102. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1103. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1104. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1105. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1106. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1107. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1108. X -1  -1  -1  -1  -1  -1 
  1109. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1110. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1111. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1112. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1113. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1114. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1115. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1116. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1117. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1118. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1119. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1120. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1121. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1122. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1123. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1124. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1125. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1126. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1127. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1128. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1129. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1130. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1131. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1132. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1133. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1134. X -1  -1  -1  -1  -1  -1 
  1135. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1136. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1137. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1138. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1139. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1140. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1141. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1142. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1143. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1144. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1145. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1146. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1147. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1148. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1149. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1150. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1151. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1152. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1153. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1154. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1155. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1156. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1157. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1158. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1159. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1160. X -1  -1  -1  -1  -1  -1 
  1161. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1162. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1163. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1164. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1165. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1166. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1167. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1168. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1169. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1170. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1171. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1172. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1173. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1174. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1175. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1176. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1177. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1178. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1179. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1180. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1181. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1182. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1183. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1184. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1185. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1186. X -1  -1  -1  -1  -1  -1 
  1187. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1188. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1189. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1190. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1191. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1192. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1193. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1194. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1195. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1196. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1197. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1198. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1199. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1200. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1201. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1202. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1203. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1204. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1205. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1206. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1207. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1208. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1209. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1210. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1211. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1212. X -1  -1  -1  -1  -1  -1 
  1213. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1214. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1215. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1216. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1217. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1218. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1219. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1220. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1221. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1222. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1223. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1224. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1225. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1226. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1227. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1228. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1229. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1230. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1231. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1232. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1233. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1234. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1235. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1236. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1237. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1238. X -1  -1  -1  -1  -1  -1 
  1239. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1240. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1241. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1242. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1243. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1244. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1245. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1246. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1247. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1248. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1249. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1250. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1251. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1252. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1253. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1254. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1255. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1256. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1257. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1258. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1259. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1260. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1261. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1262. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1263. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1264. X -1  -1  -1  -1  -1  -1 
  1265. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1266. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1267. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1268. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1269. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1270. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1271. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1272. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1273. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1274. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1275. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1276. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1277. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1278. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1279. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1280. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1281. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1282. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1283. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1284. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1285. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1286. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1287. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1288. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1289. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1290. X -1  -1  -1  -1  -1  -1 
  1291. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1292. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1293. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1294. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1295. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1296. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1297. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1298. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1299. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1300. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1301. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1302. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1303. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1304. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1305. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1306. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1307. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1308. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1309. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1310. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1311. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1312. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1313. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1314. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1315. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1316. X -1  -1  -1  -1  -1  -1 
  1317. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1318. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1319. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1320. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1321. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1322. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1323. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1324. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1325. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1326. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1327. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1328. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1329. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1330. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1331. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1332. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1333. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1334. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1335. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1336. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1337. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1338. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1339. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1340. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1341. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1342. X -1  -1  -1  -1  -1  -1 
  1343. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1344. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1345. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1346. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1347. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1348. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1349. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1350. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1351. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1352. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1353. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1354. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1355. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1356. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1357. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1358. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1359. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1360. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1361. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1362. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1363. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1364. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1365. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1366. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1367. X -1  -1  -1  -1  -1  -1  -1  -1  -1  -1 
  1368. X -1  -1  -1  -1  -1  -1 
  1369. END_OF_test3.perm
  1370. if test 16800 -ne `wc -c <test3.perm`; then
  1371.     echo shar: \"test3.perm\" unpacked with wrong size!
  1372. fi
  1373. # end of overwriting check
  1374. fi
  1375. echo shar: End of archive 7 \(of 11\).
  1376. cp /dev/null ark7isdone
  1377. MISSING=""
  1378. for I in 1 2 3 4 5 6 7 8 9 10 11 ; do
  1379.     if test ! -f ark${I}isdone ; then
  1380.     MISSING="${MISSING} ${I}"
  1381.     fi
  1382. done
  1383. if test "${MISSING}" = "" ; then
  1384.     echo You have unpacked all 11 archives.
  1385.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1386. else
  1387.     echo You still need to unpack the following archives:
  1388.     echo "        " ${MISSING}
  1389. fi
  1390. ##  End of shell archive.
  1391. exit 0
  1392.